package com.yangxk.kadmin.web.common;

import com.yangxk.kadmin.web.module.system.po.User;

public class SessionUserHolder {
    private static final ThreadLocal<User> tl = new ThreadLocal<>();

    public static void set(User user) {
        tl.set(user);
    }

    public static User get() {
        return tl.get();
    }

    public static long getUserId() {
        return tl.get().getId();
    }

    public static void remove() {
        tl.remove();
    }
}
